#ifndef SMARTPLAYLIST_HPP_INCLUDED
#define SMARTPLAYLIST_HPP_INCLUDED

#include <QtCore/QFile>
#include <QtCore/QString>
#include <QtCore/QVector>
#include <QtCore/QMap>

namespace SPM {
/// \brief Operators used to filter data
typedef enum {
    //global operators
    equals=0,
    //number operators
    lowerThan=1,
    greaterThan=2,
    between=3,
    about=4,
    //string operators
    contains=6,
    in=7
} operatorType;
/// \brief Data types of the value
typedef enum {
    number=0,
    string=1,
    time=2, //time format: HH:II:SS
    gap=3, //gap define 2 numbers in value (ie: 3-5 means between 3 and 5)
    numberList=4, //possible item value (ie: 2,3,5,8)
    stringList=5,  //possible item value (ie: "rock","po","dance")
    date=6, //format: YYYY/MM/DD
    datetime=7 //format: YYYY/MM/DD HH:II:SS
} valueType;
/// \brief Condition operator to filter tracks
typedef enum {
    operator_or=0,
    operator_and=1,
    operator_xor=2,
    operator_xand=3
} conditionType;

static const char* fieldValue[] = {"Title","Artist","Album","Genre","Year","Added","Last played","Rating","BPM","Bitrate",
    "Filesize","Sampling","Duration","Play count","Composer"};

class Field {
    private:
        QString name;
        QString value;
        operatorType operation;
        valueType dataType;
    public:
        Field(QString n);
        Field(QString n, operatorType ot, QString v);
};
class Condition {
    public:
        Condition();
        QVector<Field> fields;
        QVector<Condition> fields;
        conditionType condition;
};
class Group : Condition {
    public:
        Group();
};
class SmartPlaylist : Condition {
    private:
        QFile* file;
        //history
        //played
    public:
        float version;
        SmartPlaylist();
};

}
#endif // SMARTPLAYLIST_HPP_INCLUDED
